package july.framework.exsolver.bean.impl;

import com.alibaba.fastjson.JSONObject;
import july.framework.exsolver.bean.*;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Data
public class LineResolver implements Resolver {
    private String id;
    private String type; // 处理类型 目前有 line:行处理， multi：多行处理， 后续可以支持 block:块数据处理
    private String returnType;

    private String startRow;
    private String startColumn;
    private String endRow;
    private String endColumn;

    private Location[] start;
    private Location[] end;

    private List<Check> checks;
    private List<Prop> props;


    @Override
    public void init(JSONObject param) {

        this.id = param.get("id").toString();
        this.returnType = param.get("returnType").toString();
        this.type = param.get("type").toString();

        //System.out.println(param);
    }


    @Override
    public <T> List<T> getAnalizedData(Class<T> returnType, Map<String, List<ExRow>> sheetMap) throws
            IllegalAccessException, InstantiationException {

        List<T> res = new ArrayList<>();


        Object obj = returnType.newInstance();
        res.add((T)obj);

        return null;
    }
}
